-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the raising to high level operator within Unify Axis #565
base: main
Are you sure you want to change the base?
Conversation
…ed variables we will know the right relationship.
…nd the inames in an IndexLambda.
Unsubscribing... @-mention or request review once it's ready for a look or needs attention. |
…ator working on an IndexLambda.
…nternal function.
…g the equations and propagate that information through.
…can store the reduction string as well.
as its aggregate. | ||
""" | ||
|
||
if isinstance(expr.aggregate, prim.Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a recursion. Subscripts can contain subscripts.
@@ -156,7 +198,7 @@ def __init__(self, tag_t: type[Tag]) -> None: | |||
|
|||
# axis_to_var: mapping from (array, iaxis) to the variable to be | |||
# used for unification. | |||
self.axis_to_var: bidict[tuple[Array, int], str] = bidict() | |||
self.axis_to_var: bidict[tuple[Array, int | str], str] = bidict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you're changing what identifies an axis here. Why? How? Will this still be unique? (The answers to these questions should become documentation.)
if isinstance(var_ind_name, prim.Variable): | ||
lhs: str = self.get_var_for_axis(expr.bindings[vname], | ||
axis_ind) | ||
if IDX_LAMBDA_INAME.fullmatch(var_ind_name.name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an else
case here, to document that you've thought about it. E.g.
else:
raise AssertionError()
for vname, set_of_ind_tuple in index_expr_used.items(): | ||
for ind_tuple in set_of_ind_tuple: | ||
for axis_ind, var_ind_name in enumerate(ind_tuple): | ||
if isinstance(var_ind_name, prim.Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an else
case here, to document that you've thought about it. E.g.
else:
raise AssertionError()
Unsubscribing... @-mention or request review once it's ready for a look or needs attention. |
No description provided.